<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>PlanarGC: CutSegment Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PlanarGC
   &#160;<span id="projectnumber">1.0.2</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('a00015.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">CutSegment Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="a00037_source.html">CutSegment.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for CutSegment:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
 <div class="center">
  <img src="a00015.png" usemap="#CutSegment_map" alt=""/>
  <map id="CutSegment_map" name="CutSegment_map">
<area href="a00013.html" alt="CutGrid" shape="rect" coords="0,0,79,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a135405b0e11645adef2d53b24acde00f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a135405b0e11645adef2d53b24acde00f">CutSegment</a> (int width, int height)</td></tr>
<tr class="memitem:a2ad1fcccd8b1ac27549053cc248488a6"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a2ad1fcccd8b1ac27549053cc248488a6">~CutSegment</a> ()</td></tr>
<tr class="memitem:add5dccff76d4f4d03cdf4a7af379ff49"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#add5dccff76d4f4d03cdf4a7af379ff49">setImageData</a> (const uchar *grey)</td></tr>
<tr class="memitem:a273918788a65e884296f6c2dde1de4fa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a273918788a65e884296f6c2dde1de4fa">setImageData</a> (const uchar *r, const uchar *g, const uchar *b)</td></tr>
<tr class="memitem:afd744543aac8af47a9df134569b80358"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#afd744543aac8af47a9df134569b80358">setSourceSink</a> (const uchar *stMask, uchar source, uchar sink)</td></tr>
<tr class="memitem:aacf6591687eb8d6ecbbc769cec0a711f"><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#aacf6591687eb8d6ecbbc769cec0a711f">gradient</a> (double color1, double color2)</td></tr>
<tr class="memitem:a2a6f6f03d56eaae0c4ee3e3f66a191ca"><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a2a6f6f03d56eaae0c4ee3e3f66a191ca">gradient</a> (double color1[3], double color2[3])</td></tr>
<tr class="memitem:a781014344a508ef988bca1836e349c39"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a781014344a508ef988bca1836e349c39">segment</a> ()</td></tr>
<tr class="memitem:ac5f5144a2f5b6355abd1fac7decd7084"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00014.html#a0e28d67a0303b0b1a43bb9abbad02989">CutPlanar::ELabel</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#ac5f5144a2f5b6355abd1fac7decd7084">getLabel</a> (int x, int y)</td></tr>
<tr class="memitem:ad6d3c208ed3796f318844e6dc253ad07"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#ad6d3c208ed3796f318844e6dc253ad07">getLabels</a> (<a class="el" href="a00014.html#a0e28d67a0303b0b1a43bb9abbad02989">CutPlanar::ELabel</a> *lmask)</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_types_a00013"><td colspan="2" onclick="javascript:toggleInherit('pub_types_a00013')"><img src="closed.png" alt="-"/>&nbsp;Private Types inherited from <a class="el" href="a00013.html">CutGrid</a></td></tr>
<tr class="memitem:aa6cd9f5a92249e24275933054e182227 inherit pub_types_a00013"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227">EDir</a> { <br/>
&#160;&#160;<a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227a7e9ffe4456aaa21d0eb97ea26111f57c">DIR_EAST</a>, 
<br/>
&#160;&#160;<a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227a0bc0dca36823c705e9472b4ecc911933">DIR_NORTH</a>, 
<br/>
&#160;&#160;<a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227ad2ae5884c9205af2a4f30094cdcff70f">DIR_WEST</a>, 
<br/>
&#160;&#160;<a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227a3d4e2e8cc0c4ec4841d60f72aaed6974">DIR_SOUTH</a>
<br/>
 }</td></tr>
<tr class="inherit_header pub_methods_a00013"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_a00013')"><img src="closed.png" alt="-"/>&nbsp;Private Member Functions inherited from <a class="el" href="a00013.html">CutGrid</a></td></tr>
<tr class="memitem:aaf9451998cd6a4164f290cb9141c325e inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#aaf9451998cd6a4164f290cb9141c325e">CutGrid</a> (int nRows, int nCols)</td></tr>
<tr class="memitem:a443d29599d9069e39ba217017869c84e inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#a443d29599d9069e39ba217017869c84e">~CutGrid</a> ()</td></tr>
<tr class="memitem:a6f59d27717bde7636f75283adcde79ee inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#a6f59d27717bde7636f75283adcde79ee">setSource</a> (int row, int col)</td></tr>
<tr class="memitem:a8c71b2544107cbd2f90c676983b5b761 inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#a8c71b2544107cbd2f90c676983b5b761">setSink</a> (int row, int col)</td></tr>
<tr class="memitem:a685e08cd30045408d1030f4275be9dba inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#a685e08cd30045408d1030f4275be9dba">getSource</a> (int &amp;row, int &amp;col)</td></tr>
<tr class="memitem:a2b645cacf13ccd145c8428346873f45c inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#a2b645cacf13ccd145c8428346873f45c">getSink</a> (int &amp;row, int &amp;col)</td></tr>
<tr class="memitem:a132d15a5fd6ef1b9215a0a239a6e1b0c inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#a132d15a5fd6ef1b9215a0a239a6e1b0c">setEdgeCostFunction</a> (CapType(*edgeCostFunc)(int row, int col, <a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227">EDir</a> dir))</td></tr>
<tr class="memitem:a55e1ee8a86ead09b026f8cfc9f779afd inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">virtual CapType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#a55e1ee8a86ead09b026f8cfc9f779afd">edgeCost</a> (int row, int col, <a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227">EDir</a> dir)</td></tr>
<tr class="memitem:af87c1597a79356c09b6d1665ed9cb936 inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#af87c1597a79356c09b6d1665ed9cb936">getMaxFlow</a> ()</td></tr>
<tr class="memitem:a363ca83b7da4990b15fe3c0410617c77 inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00014.html#a0e28d67a0303b0b1a43bb9abbad02989">CutPlanar::ELabel</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#a363ca83b7da4990b15fe3c0410617c77">getLabel</a> (int row, int col)</td></tr>
<tr class="memitem:ade48fa853f0e136a586f8eea360840e2 inherit pub_methods_a00013"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00013.html#ade48fa853f0e136a586f8eea360840e2">getLabels</a> (<a class="el" href="a00014.html#a0e28d67a0303b0b1a43bb9abbad02989">CutPlanar::ELabel</a> *lmask)</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="a00015.html">CutSegment</a> provides an interface to compute a graph cut based image segmentation. In order to define the problem as a planar graph cut problem, we assume a 4-connected neighborhood for every pixel. In addition, the subset of pixels that are previously selected as being either part of the source or the sink set have to be connected subsets.<br/>
 The edges for <a class="el" href="a00015.html">CutSegment</a> are uniquely defined by the color gradient between adjacent pixels. In the case of more complex edges, we recommend to use the class <a class="el" href="a00013.html">CutGrid</a> instead. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="a00003.html#_a0">cutsegment.cpp</a>.</dd>
</dl></div><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a135405b0e11645adef2d53b24acde00f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CutSegment::CutSegment </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>the constructor creates a graph of <code>width</code> times <code>height</code> vertices and the associated faces and edges. To adapt the class to one's need, it is recommended to rewrite <a class="el" href="a00015.html#aacf6591687eb8d6ecbbc769cec0a711f">CutSegment::gradient</a> for greyscale or color images. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="a00003.html#a1">cutsegment.cpp</a>.</dd>
</dl>
<p>References <a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227a7e9ffe4456aaa21d0eb97ea26111f57c">CutGrid::DIR_EAST</a>, <a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227a0bc0dca36823c705e9472b4ecc911933">CutGrid::DIR_NORTH</a>, <a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227a3d4e2e8cc0c4ec4841d60f72aaed6974">CutGrid::DIR_SOUTH</a>, and <a class="el" href="a00013.html#aa6cd9f5a92249e24275933054e182227ad2ae5884c9205af2a4f30094cdcff70f">CutGrid::DIR_WEST</a>.</p>

</div>
</div>
<a class="anchor" id="a2ad1fcccd8b1ac27549053cc248488a6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">CutSegment::~CutSegment </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>the destructor frees all the memory that was reserved for the vertices, edges and faces created by the constructor. </p>

</div>
</div>
<h2>Member Function Documentation</h2>
<a class="anchor" id="add5dccff76d4f4d03cdf4a7af379ff49"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CutSegment::setImageData </td>
          <td>(</td>
          <td class="paramtype">const uchar *&#160;</td>
          <td class="paramname"><em>grey</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>provides the image data that should be segmented.<br/>
 The data of the greyscale image is provided as an array <code>grey</code> of <code>width*height</code> pixels that are stored row-wise. </p>

</div>
</div>
<a class="anchor" id="a273918788a65e884296f6c2dde1de4fa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CutSegment::setImageData </td>
          <td>(</td>
          <td class="paramtype">const uchar *&#160;</td>
          <td class="paramname"><em>r</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uchar *&#160;</td>
          <td class="paramname"><em>g</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uchar *&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>provides the image data that should be segmented.<br/>
 The data of the RGB-image is provided as three arrays of <code>width*height</code> pixels that are stored row-wise. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">r</td><td>red channel of the image. </td></tr>
    <tr><td class="paramname">g</td><td>green channel of the image. </td></tr>
    <tr><td class="paramname">b</td><td>blue channel of the image. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="afd744543aac8af47a9df134569b80358"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CutSegment::setSourceSink </td>
          <td>(</td>
          <td class="paramtype">const uchar *&#160;</td>
          <td class="paramname"><em>stMask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uchar&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uchar&#160;</td>
          <td class="paramname"><em>sink</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>defines the pixel subsets that are part of the source and the sink set.<br/>
 Both, the preselected source and sink sets have to be connected. If this is not the case, the method will select one connected source component as source set and one connected sink component as sink set. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stMask</td><td>a mask that assign to every pixel non-negative values. </td></tr>
    <tr><td class="paramname">source</td><td>the value in <code>stMask</code> that describes the preselected source set. </td></tr>
    <tr><td class="paramname">sink</td><td>the value in <code>stMask</code> that describes the preselected sink set. </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="a00013.html#a8c71b2544107cbd2f90c676983b5b761">CutGrid::setSink()</a>, and <a class="el" href="a00013.html#a6f59d27717bde7636f75283adcde79ee">CutGrid::setSource()</a>.</p>

</div>
</div>
<a class="anchor" id="aacf6591687eb8d6ecbbc769cec0a711f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double CutSegment::gradient </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>color1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>color2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>computes a geodesic-active-contour like cost between two neighboring pixels. The cost depends only on the greyscale values <code>color1</code> and <code>color2</code> of these pixels and should be monotonically decreasing wrt to the distance <code>|color1-color2|</code> . </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="a00003.html#a2">cutsegment.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a2a6f6f03d56eaae0c4ee3e3f66a191ca"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double CutSegment::gradient </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>color1</em>[3], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>color2</em>[3]&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>computes a geodesic-active-contour like cost between two neighboring pixels. The cost depends only on the RGB values <code>color1</code> and <code>color2</code> of these pixels and should be monotonically decreasing wrt to the distance <code>||color1-color2||</code> . </p>

</div>
</div>
<a class="anchor" id="a781014344a508ef988bca1836e349c39"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double CutSegment::segment </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>returns the value of the minimum energy wrt to the geodesic-active-contour like energy functional defined by <a class="el" href="a00015.html#aacf6591687eb8d6ecbbc769cec0a711f">gradient</a>. </p>

<p>References <a class="el" href="a00013.html#af87c1597a79356c09b6d1665ed9cb936">CutGrid::getMaxFlow()</a>.</p>

</div>
</div>
<a class="anchor" id="ac5f5144a2f5b6355abd1fac7decd7084"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00014.html#a0e28d67a0303b0b1a43bb9abbad02989">CutPlanar::ELabel</a> CutSegment::getLabel </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>returns the label of a specific pixel after segmentation. </p>

<p>Referenced by <a class="el" href="a00015.html#ad6d3c208ed3796f318844e6dc253ad07">getLabels()</a>.</p>

</div>
</div>
<a class="anchor" id="ad6d3c208ed3796f318844e6dc253ad07"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CutSegment::getLabels </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00014.html#a0e28d67a0303b0b1a43bb9abbad02989">CutPlanar::ELabel</a> *&#160;</td>
          <td class="paramname"><em>lmask</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>writes the value of every pixel's label into the pre-allocated <code>lmask</code>. The method uses the row-wise format that was also used for the image data (see <a class="el" href="a00015.html#add5dccff76d4f4d03cdf4a7af379ff49">setImageData</a>). </p>

<p>References <a class="el" href="a00015.html#ac5f5144a2f5b6355abd1fac7decd7084">getLabel()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<hr class="footer"/><address style="text-align: right;"><small>
  &copy; 2009 - 2013 by Eno T&ouml;ppe, Frank R. Schmidt
  <br/>
  generated by <a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a>
</small></address>
